package org.example.threadobjectclasscommonmethods;

/**
 * @description: 多线程异常捕获器
 * @author: MoodAir
 * @Date: 2020/6/9 0009 22:48
 */
public class UseOwnUncaughtExceptionHandler implements Runnable {

  public static void main(String[] args) {
    Thread.setDefaultUncaughtExceptionHandler(new UncaughtException("测试"));
    new Thread(new UseOwnUncaughtExceptionHandler()).start();
  }

  @Override
  public void run() {
    throw new RuntimeException("抛出异常");
  }
}